package com.freshminds.saudiproject;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class CourseAdapter extends BaseAdapter
{
	
	Context context;
	String []data;
	LayoutInflater layoutInflater;
	
	
public CourseAdapter(Context context,String []data) 
{
	this.context=context;
	this.data=data;
	layoutInflater=(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	
}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return data.length;
	}

	@Override
	public Object getItem(int position)
	{
		// TODO Auto-generated method stub
		return data[position];
	}

	@Override
	public long getItemId(int id) {
		// TODO Auto-generated method stub
		return id;
	}

	@Override
	public View getView(int position, View view, ViewGroup arg2) 
	{
		
		if(view==null)
		{
			view =layoutInflater.inflate(R.layout.course_row, null);
		}		
		return view;
	}

}
